package com.kede.domain;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.kede.ienum.store.CertiStatueEnum;
import com.kede.typehanlder.store.StoreStatueEnumTypeHanlder;
import lombok.Data;

import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.math.BigDecimal;

/**
 * 骑手认证管理
 * @TableName sy_zhi_user_certified
 */
@TableName(value ="sy_zhi_user_certified")
@Data
public class ZhiUserCertifiedDomain implements Serializable {
    /**
     * 
     */
    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;

    /**
     * 用户id
     */
    @NotNull(message = "userid 不可为空")
    @TableField(value = "user_id")
    private Integer userId;

    /**
     * 0=未支付,1=已支付
     */
    @TableField(value = "is_pay")
    private Integer isPay;

    /**
     * 门店名称
     */
    @NotEmpty(message = "门店名称 不可为空")
    @TableField(value = "store_name")
    private String storeName;

    /**
     * 姓名
     */
    @NotEmpty(message = "联系人 不可为空")
    @TableField(value = "user_name")
    private String userName;

    /**
     * 门店头像
     */
    @TableField(value = "avatarimage")
    private String avatarimage;

    /**
     * 联系电话
     */
    @NotEmpty(message = "联系电话 不可为空")
    @TableField(value = "mobile")
    private String mobile;

    /**
     * 居住地址
     */
    @TableField(value = "address")
    private String address;

    /**
     * 详细地址
     */
    @TableField(value = "address_detaail")
    private String addressDetaail;

    /**
     * 身份证号
     */
    @NotEmpty(message = "身份证号 不可为空")
    @TableField(value = "card_no")
    private String cardNo;

    /**
     * 身份证人像
     */
    @TableField(value = "headimage")
    private String headimage;

    /**
     * 身份证国徽
     */
    @TableField(value = "bgimage")
    private String bgimage;

    /**
     * 营业执照
     */
    @TableField(value = "zhizhaoimage")
    private String zhizhaoimage;

    /**
     * 1营业中0休息中
     */
    @TableField(value = "store_status")
    private Integer storeStatus;

    /**
     * 经度
     */
    @NotEmpty(message = "经度 不可为空")
    @TableField(value = "lng")
    private String lng;

    /**
     * 维度
     */
    @NotEmpty(message = "维度 不可为空")
    @TableField(value = "lat")
    private String lat;

    /**
     * 1门店2区代理3市代理
     */
    @TableField(value = "type")
    @NotNull(message = "1门店2区代理3市代理 认证类型不可为空")
    private Integer type;

    /**
     * 状态0审核中1审核通过2审核拒绝
     */
    @TableField(value = "status",typeHandler = StoreStatueEnumTypeHanlder.class)
    private CertiStatueEnum status;

    /**
     * 拒绝原因
     */
    @TableField(value = "reason")
    private String reason;

    /**
     * 营业状态1营业中0歇业
     */
    @TableField(value = "is_work")
    private Integer isWork;

    /**
     * 订单编号
     */
    @TableField(value = "order_sn")
    private String orderSn;

    /**
     * 认证金额
     */
    @TableField(value = "money")
    private BigDecimal money;

    /**
     * 营业开始时间
     */
    @TableField(value = "starttime")
    private String starttime;

    /**
     * 营业结束时间
     */
    @TableField(value = "endtime")
    private String endtime;

    /**
     * 时间
     */
    @TableField(value = "createtime")
    private Integer createtime;

    /**
     * 时间
     */
    @TableField(value = "updatetime")
    private Integer updatetime;

    /**
     * 
     */
    @TableField(value = "sheng")
    private String sheng;

    /**
     * 
     */
    @TableField(value = "shi")
    private String shi;

    /**
     * 
     */
    @TableField(value = "qu")
    private String qu;

    /**
     * 区级地区编码
     */
    @TableField(value = "area_code")
    private Integer areaCode;

    /**
     * 服务距离 单位米
     */
    @TableField(value = "service_distance")
    private Integer serviceDistance;

    /**
     * 验收款  是应该获得的钱但是需要验证后给
     */
    @TableField(value = "valid_money")
    private BigDecimal validMoney;

    /**
     * 是否开启现金置换
     */
    @TableField(value = "enable_zhi_money")
    private Integer enableZhiMoney;

    /**
     * 是否开启自己上传功能
     */
    @TableField(value = "enable_own_upload")
    private Integer enableOwnUpload;

    /**
     * 是否开启用户无限量上传衣服 1开启，0 不开启
     */
    @TableField(value = "enable_user_upload")
    private Integer enableUserUpload;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    /**
     * 距离
     */
    @TableField(exist = false)
    private String distance;

    /**
     * 用户是否可以下单 1是  0否
     * 返回给用户端的前端 做判断了
     */
    @TableField(exist = false)
    private Integer canCreatOder;

    /**
     * 用户可以选择门店去置换
     */
    @TableField(exist = false)
    private Integer zhiCanSlielectStore = 1;

    /**
     * 用户已经在旧门店换的数量
     */
    @TableField(exist = false)
    private Integer zhiCurCount = -1;

    /**
     * 旧门店限制的置换数
     */
    @TableField(exist = false)
    private Integer zhiLimitCount = -1;



    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        ZhiUserCertifiedDomain other = (ZhiUserCertifiedDomain) that;
        return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
            && (this.getUserId() == null ? other.getUserId() == null : this.getUserId().equals(other.getUserId()))
            && (this.getIsPay() == null ? other.getIsPay() == null : this.getIsPay().equals(other.getIsPay()))
            && (this.getStoreName() == null ? other.getStoreName() == null : this.getStoreName().equals(other.getStoreName()))
            && (this.getUserName() == null ? other.getUserName() == null : this.getUserName().equals(other.getUserName()))
            && (this.getAvatarimage() == null ? other.getAvatarimage() == null : this.getAvatarimage().equals(other.getAvatarimage()))
            && (this.getMobile() == null ? other.getMobile() == null : this.getMobile().equals(other.getMobile()))
            && (this.getAddress() == null ? other.getAddress() == null : this.getAddress().equals(other.getAddress()))
            && (this.getAddressDetaail() == null ? other.getAddressDetaail() == null : this.getAddressDetaail().equals(other.getAddressDetaail()))
            && (this.getCardNo() == null ? other.getCardNo() == null : this.getCardNo().equals(other.getCardNo()))
            && (this.getHeadimage() == null ? other.getHeadimage() == null : this.getHeadimage().equals(other.getHeadimage()))
            && (this.getBgimage() == null ? other.getBgimage() == null : this.getBgimage().equals(other.getBgimage()))
            && (this.getZhizhaoimage() == null ? other.getZhizhaoimage() == null : this.getZhizhaoimage().equals(other.getZhizhaoimage()))
            && (this.getStoreStatus() == null ? other.getStoreStatus() == null : this.getStoreStatus().equals(other.getStoreStatus()))
            && (this.getLng() == null ? other.getLng() == null : this.getLng().equals(other.getLng()))
            && (this.getLat() == null ? other.getLat() == null : this.getLat().equals(other.getLat()))
            && (this.getType() == null ? other.getType() == null : this.getType().equals(other.getType()))
            && (this.getStatus() == null ? other.getStatus() == null : this.getStatus().equals(other.getStatus()))
            && (this.getReason() == null ? other.getReason() == null : this.getReason().equals(other.getReason()))
            && (this.getIsWork() == null ? other.getIsWork() == null : this.getIsWork().equals(other.getIsWork()))
            && (this.getOrderSn() == null ? other.getOrderSn() == null : this.getOrderSn().equals(other.getOrderSn()))
            && (this.getMoney() == null ? other.getMoney() == null : this.getMoney().equals(other.getMoney()))
            && (this.getStarttime() == null ? other.getStarttime() == null : this.getStarttime().equals(other.getStarttime()))
            && (this.getEndtime() == null ? other.getEndtime() == null : this.getEndtime().equals(other.getEndtime()))
            && (this.getCreatetime() == null ? other.getCreatetime() == null : this.getCreatetime().equals(other.getCreatetime()))
            && (this.getUpdatetime() == null ? other.getUpdatetime() == null : this.getUpdatetime().equals(other.getUpdatetime()))
            && (this.getSheng() == null ? other.getSheng() == null : this.getSheng().equals(other.getSheng()))
            && (this.getShi() == null ? other.getShi() == null : this.getShi().equals(other.getShi()))
            && (this.getQu() == null ? other.getQu() == null : this.getQu().equals(other.getQu()))
            && (this.getAreaCode() == null ? other.getAreaCode() == null : this.getAreaCode().equals(other.getAreaCode()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
        result = prime * result + ((getUserId() == null) ? 0 : getUserId().hashCode());
        result = prime * result + ((getIsPay() == null) ? 0 : getIsPay().hashCode());
        result = prime * result + ((getStoreName() == null) ? 0 : getStoreName().hashCode());
        result = prime * result + ((getUserName() == null) ? 0 : getUserName().hashCode());
        result = prime * result + ((getAvatarimage() == null) ? 0 : getAvatarimage().hashCode());
        result = prime * result + ((getMobile() == null) ? 0 : getMobile().hashCode());
        result = prime * result + ((getAddress() == null) ? 0 : getAddress().hashCode());
        result = prime * result + ((getAddressDetaail() == null) ? 0 : getAddressDetaail().hashCode());
        result = prime * result + ((getCardNo() == null) ? 0 : getCardNo().hashCode());
        result = prime * result + ((getHeadimage() == null) ? 0 : getHeadimage().hashCode());
        result = prime * result + ((getBgimage() == null) ? 0 : getBgimage().hashCode());
        result = prime * result + ((getZhizhaoimage() == null) ? 0 : getZhizhaoimage().hashCode());
        result = prime * result + ((getStoreStatus() == null) ? 0 : getStoreStatus().hashCode());
        result = prime * result + ((getLng() == null) ? 0 : getLng().hashCode());
        result = prime * result + ((getLat() == null) ? 0 : getLat().hashCode());
        result = prime * result + ((getType() == null) ? 0 : getType().hashCode());
        result = prime * result + ((getStatus() == null) ? 0 : getStatus().hashCode());
        result = prime * result + ((getReason() == null) ? 0 : getReason().hashCode());
        result = prime * result + ((getIsWork() == null) ? 0 : getIsWork().hashCode());
        result = prime * result + ((getOrderSn() == null) ? 0 : getOrderSn().hashCode());
        result = prime * result + ((getMoney() == null) ? 0 : getMoney().hashCode());
        result = prime * result + ((getStarttime() == null) ? 0 : getStarttime().hashCode());
        result = prime * result + ((getEndtime() == null) ? 0 : getEndtime().hashCode());
        result = prime * result + ((getCreatetime() == null) ? 0 : getCreatetime().hashCode());
        result = prime * result + ((getUpdatetime() == null) ? 0 : getUpdatetime().hashCode());
        result = prime * result + ((getSheng() == null) ? 0 : getSheng().hashCode());
        result = prime * result + ((getShi() == null) ? 0 : getShi().hashCode());
        result = prime * result + ((getQu() == null) ? 0 : getQu().hashCode());
        result = prime * result + ((getAreaCode() == null) ? 0 : getAreaCode().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", id=").append(id);
        sb.append(", userId=").append(userId);
        sb.append(", isPay=").append(isPay);
        sb.append(", storeName=").append(storeName);
        sb.append(", userName=").append(userName);
        sb.append(", avatarimage=").append(avatarimage);
        sb.append(", mobile=").append(mobile);
        sb.append(", address=").append(address);
        sb.append(", addressDetaail=").append(addressDetaail);
        sb.append(", cardNo=").append(cardNo);
        sb.append(", headimage=").append(headimage);
        sb.append(", bgimage=").append(bgimage);
        sb.append(", zhizhaoimage=").append(zhizhaoimage);
        sb.append(", storeStatus=").append(storeStatus);
        sb.append(", lng=").append(lng);
        sb.append(", lat=").append(lat);
        sb.append(", type=").append(type);
        sb.append(", status=").append(status);
        sb.append(", reason=").append(reason);
        sb.append(", isWork=").append(isWork);
        sb.append(", orderSn=").append(orderSn);
        sb.append(", money=").append(money);
        sb.append(", starttime=").append(starttime);
        sb.append(", endtime=").append(endtime);
        sb.append(", createtime=").append(createtime);
        sb.append(", updatetime=").append(updatetime);
        sb.append(", sheng=").append(sheng);
        sb.append(", shi=").append(shi);
        sb.append(", qu=").append(qu);
        sb.append(", areaCode=").append(areaCode);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}